/*
传值_子类
User: shy
Date: 2024-04-16 10:44
All rights reserved by Kong Fanqun
*/
<template>
  <div class="cz_1_main">
    <div @click="cz_click">子类中的点击事件</div>
    <span>子类中的插槽</span>
    <slot name="slot_1"></slot>
    <slot name="slot_2"></slot>
    <slot name="slot_3"></slot>
    <span>子类中获取父类传值</span>
    <div>{{ test22 }}</div>
  </div>
</template>

<script setup>
import {reactive, ref, onMounted} from "vue";

const zl_value = ref("子类的值");
const emit_ = defineEmits(['childValue']);
defineProps({
  test22: String
})
defineExpose({
  click2
})

function cz_click() {
  emit_("childValue", zl_value);
}

function click2(str) {
  console.log("父类方法传值2222" + str)
}
</script>

<style scoped>
.cz_1_main {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
</style>